package com.zyf.qa.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.zyf.qa.pojo.Problem;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;
import org.springframework.stereotype.Repository;

import java.util.List;

@Mapper
@Repository
public interface ProblemDao extends BaseMapper<Problem> {
    @Select("select * from tb_problem p where id in( select problemid from tb_pl where labelid=#{labelid} ) order by replytime desc")
    List<Problem> findNewListByLabelId(@Param("labelid") String labelid);
    @Select("select * from tb_problem p where id in( select problemid from tb_pl where labelid=#{labelid} ) order by reply desc")
    List<Problem> findHotListByLabelId(@Param("labelid") String labelid);
    @Select("select * from tb_problem p where id in( select problemid from tb_pl where labelid=#{labelid} ) and reply=#{0} order by createtime desc")
    List<Problem> findWaitListByLabelId(@Param("labelid") String labelid);
}
